<div class="row">    
    <div class="col-xs-12 col-md-6">
      <h6 class="header smaller lighter blue">账号信息</h6>
      <table class="table table-hover table-striped table-bordered nonborder">
        <thead>
        <tr>
          <th class="center">帐号</th>
          <th class="align-middle">姓名</th>
          <th class="center">签到</th>
          <th class="center">积分</th>
          <th class="hidden-480 center">注册日期</th>
          <th class="align-right">操作</th>
        </tr>
        </thead>
        <tbody>          
          @foreach ($users as $i=>$user)   
          <tr class="bank">
            <td class="center">
              <span class="smaller-80"><a href="{{route('user.edit',array('uid'=>$user->id))}}">{{ $user->account }}</a></span>
            </td>
            <td class="align-middle">{!! $user->present()->face !!}<a
                  href="{{route('user.view',array('uid'=>$user->id))}}" class="uid"
                  data-id="{{ $user->id }}">{{ $user->name }}</a>
            </td>
            <td class="center b-sign">{{ $user->summary->signs == 0?'':$user->summary->signs }}</td>
            <td class="center b-point">{{ $user->summary->points == 0?'':$user->summary->points }}</td>
            <td class="hidden-480 center"><span class="grey smaller-80">{{ date('Y-m-d',$user->created_at) }}</span></td>
            <td class="align-right">
              {!! $user->present()->sign !!}
              {!! $user->present()->award !!}
              <a 
              href="{{route('user.print',array('uid'=>$user->id))}}" 
              class="btn btn-xs btn-light hidden-480">
              <i class="ace-icon fa fa-qrcode"></i>
              </a>
            </td>
          </tr>
          
        @endforeach
        </tbody>
      </table>

      <h6 class="header smaller lighter red">已借书籍</h6>
      @if( count($users) === 1)
      <input type="hidden" name="uid" value="{{$users[0]->id}}"/>
    
      <table id="return-list" class="table table-hover table-bordered table-striped nonborder">
        <thead>
        <tr>
          <th style="width:80px;" class="center">封面</th>
          <th class="align-middle">书名</th>
          <th class="align-middle" style="width:100px;">借阅日期</th>
          <th style="width:60px;" class="center hidden-480">书架</th>
          <th class="center" style="width:70px;">操作</th>
        </tr>
        </thead>

        <tbody>
        @foreach ($users[0]->overdue as $borrow)
          <tr>
            <td class="center"><a href="{{route('book.borrows',array('id'=>$borrow->book->id) )}}">
            <img class="lazy book-img img-error1" src="/assets/images/blank.gif" data-original="/assets/images/books/{{$borrow->book->dbid}}.jpg" /></a></td>
            <td class="align-middle smaller-80 ">{{ $borrow->book->title }}</td>
            <td class="align-middle grey smaller-80">{{date('Y-m-d',$borrow->date_begin)}}</td>
            <td class="center smaller-80">{!! $borrow->book->present()->bookStore !!}</td>
            <td class="center">
              @if ($borrow->status == 0)
                <button class="btn btn-xs btn-green3 return" type="button" data-value="{{$borrow->id}}">
                  还
                </button>
              @endif
            </td>
          </tr>
        @endforeach

        </tbody>
      </table>    
      @endif


    </div>
  
    <div class="col-xs-12 col-md-6">
      <h6 class="header smaller lighter green">书籍借阅</h6>
      @if( isset($books) && count($books)>0 )  
      <table id="book-list" class="table table-hover table-bordered table-striped nonborder">
        <thead>
        <tr>
          <th style="width:60px;" class="center">选择</th>
          <th style="width:80px;" class="center">封面</th>
          <th class="align-middle">书名</th>
          <th style="width:70px;" class="center hidden-480">书架</th>
          <th style="width:70px;" class="center hidden-480">状态</th>
        </tr>
        </thead>

        <tbody>
        @foreach ($books as $book)
          <tr class="{{$book->status == 1?'disabled':''}}">
            <td class="center"><input name="bookid" value="{{$book->id}}" type="checkbox"
                                      class="ace ace-checkbox-2 input-lg" {{$book->status == 1?'disabled':''}}><span
                  class="lbl"> </span></td>
            <td class="center"><a href="{{route('book.borrows',array('id'=>$book->id) )}}">
              <img class="lazy book-img img-error1" src="/assets/images/blank.gif" data-original="/assets/images/books/{{$book->dbid}}.jpg" />
              </a></td>
            <td class="align-middle smaller-80">{{ $book->title }}</td>
            <td class="center smaller-80">{!! $book->present()->bookStore !!}</td>
            <td class="center smaller-80">{!! $book->present()->bookStatusPresenter !!}</td>
          </tr>
        @endforeach
        <tr>
          <td colspan="5">
            <button type="submit" class="btn btn-primary borrow pull-right">
              <i class="ace-icon fa fa-check"></i>
              <span class="">确定</span>
            </button>
          </td>
        </tr>
        </tbody>
      </table>
      @endif
    </div><!-- /.col -->
  </div><!-- /.row -->

